package com.ocom.common.enums;

public enum MasterSlaveEnum {
    //写 一般主库
    MASTER(0),
    //读 一般从库
    SLAVE(1);

    private final int value;

    private MasterSlaveEnum(int value) {
        this.value = value;
    }

    public MasterSlaveEnum valueOf(int value) {
        switch (value) {
            case 0:
                return MasterSlaveEnum.MASTER;
            case 1:
                return MasterSlaveEnum.SLAVE;
            default:
                return null;
        }
    }

}
